package com.cy.service;

import com.cy.factory.RemoteFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 定义远程服务调用的接口
 * 不需要自己写实现类,由底层自动生成
 * 其中:
 * 1) name 属性的值为nacos中的服务名
 * 2) contextId 为一个上下文id,一般就写当前接口名
 */
@FeignClient(name = "sca-provider",
                contextId = "remoteProviderService",
                fallbackFactory = RemoteFallbackFactory.class)     //sca-provider为nacos中的服务名
public interface RemoteProviderService {
    @GetMapping("/provider/echo/{msg}")
    public String echoMsg(@PathVariable String msg);
}
